/*****************************************************************************
 *   Copyright 2005 Tim A Wang
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 ****************************************************************************/
package com.jb.web.bean;

import com.jb.framework.PersistentContext;
import com.jb.web.bean.inspector.OptionPropertyEditor;


public class Button extends FormField {
    static final long serialVersionUID = 123123L;

    static {
        publish(com.jb.web.bean.Button.class, DATA, "label");
        publish(com.jb.web.bean.Button.class, GENERAL, "enabled");
        publish(com.jb.web.bean.Button.class, GENERAL, "formAction",
            new OptionPropertyEditor("static:,None;Submit,Submit;Reset,Reset;"));

        //called when processUpdates is called
    }

    private String formAction;
    private String image;
    private String label;
    private boolean enabled = true;

    public void setDefault(PersistentContext pCtx) {
        super.setDefault(pCtx);
        this.setLabel("${resource.submit}");
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setFormAction(String formAction) {
        this.formAction = formAction;
    }

    public String getFormAction() {
        return formAction;
    }

    /**
     * DOCUMENT ME!
     *
     * @param pImage DOCUMENT ME!
     */
    public void setImage(String pImage) {
        image = pImage;
    }

    /**
     * DOCUMENT ME!
     *
     * @return DOCUMENT ME!
     */
    public String getImage() {
        return image;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getLabel() {
        return label;
    }
}
